<!DOCTYPE html>
<html>
<head>
    {template head}
    <script type="text/javascript" src="{SITE_THEME}mvalidate/jquery-mvalidate.js"></script><!--表单认证-->
    <link rel="stylesheet" type="text/css" href="{SITE_THEME}mvalidate/validate.css">
</head>
<body class="bg pad">
<form class="edit" action="" method="post" id="myform">
    <section class="tita">
        <span>职位信息</span>
    </section>
    <section class="space-8"></section>
    <section class="inpbox">
        <section class="inp">
            <section class="inp">
                <label>选择区域</label>
                <input type="text" value="区域" id="demo1" readonly="readonly">
                <input type="hidden" name="area" value="" id="value1">
            </section>
        </section>
        <section class="inp">
            <label>选择职位</label>
            <div class="check">
                {loop $position_list $p}
                <big>
                    <input type="checkbox" name="position[]" value="{$p['position_name']}">{$p['position_name']}
                </big>
                {/loop}
            </div>
        </section>
        <section class="inp">
            <label>选择工种</label>
            <div class="check">
                {loop $work $t}
                <big>
                    <input type="radio" value="{$t['work_id']}" name="work_id">{$t['work_name']}
                </big>
                {/loop}
            </div>
        </section>
    </section>
    <section class="space-8"></section>
    <section class="tita">
        <span>个人信息</span>
    </section>
    <section class="space-8"></section>
    <section class="inpbox">
        <section class="inp">
            <label>姓名:</label>
            <input type="text" name="name" value="" placeholder="请输入姓名" data-required="true" data-descriptions="name">
        </section>
        <section class="inp">
            <label>年龄:</label>
            <input type="text" name="age" value="" placeholder="请填写年龄" data-required="true" data-descriptions="age">
        </section>
        <section class="inp">
            <label>性别：</label>
            <select required name="sex">
                <option value="男">男</option>
                <option value="女">女</option>
            </select>
        </section>
        <section class="inp">
            <label>工资范围</label>
            <select required name="salary">
                {loop $salary $s}
                <option value="{$s[salary_id]}">{$s['salary_name']}</option>
                {/loop}
            </select>
        </section>
        <section class="inp">
            <label>从业时间：</label>
            <select required name="work_time_id">
                {loop $work_time $time}
                <option value="{$time[time_id]}">{$time['time_name']}</option>
                {/loop}
            </select>
        </section>
        <section class="inp">
            <label>联系电话:</label>
            <input type="text" name="phone" placeholder="请输入联系电话" data-required="true" data-descriptions="phone" data-pattern="^1[34578]{1}\d{9}$">
        </section>
        <!--<section class="inp">-->
            <!--<label>验证码:</label>-->
            <!--<input type="text" placeholder="请输入验证码">-->
        <!--</section>-->
    </section>
    <input type="submit" value="提交求职信息">
</form>
</body>
    <script type="text/javascript">
        $(function () {
            $("#myform").mvalidate({
                type: 1,
                onKeyup: true,
                sendForm: true,
                firstInvalidFocus: true,
                valid: function (event, options) {
                    //点击提交按钮时,表单通过验证触发函数
                    ///alert("验证通过！接下来可以做你想做的事情啦！");
                    // event.preventDefault();
                },
                invalid: function (event, status, options) {
                    //点击提交按钮时,表单未通过验证触发函数
                },
                eachField: function (event, status, options) {
                    //点击提交按钮时,表单每个输入域触发这个函数 this 执向当前表单输入域，是jquery对象
                },
                eachValidField: function (val) {
                },
                eachInvalidField: function (event, status, options) {
                },
                descriptions: {
                    area: {
                        required: '请选择您的求职区域',
                    },
                    name: {
                        required: '请输入您的姓名',
                    },
                    age: {
                        required: '请输入您的年龄',
                    },
                    phone: {
                        required: '请输入您的手机号',
                        pattern: '手机号格式错误',
                    },
//                    code: {
//                        required: '请输入验证码',
//                    },

                }
            })
            ;
        })
</script>
<script type="text/javascript">
    function unsure_click(){}
    function sure_click(){}

    var area = new LArea();
    var LAreaData = {$arr};
    area.init({
        'trigger': '#demo1',//触发选择控件的文本框，同时选择完毕后name属性输出到该位置
        'valueTo':'#value1',//选择完毕后id属性输出到该位置
        'keys':{id:'name',name:'name'},//绑定数据源相关字段 id对应valueTo的value属性输出 name对应trigger的value属性输出
        'type':0,//数据源类型
        'data':LAreaData//数据源
    });
</script>
</html>